#!/bin/bash

# 拉取翻译
tx pull --all

cd translations
for target in deepin-home deepin-home-daemon; do
    # 生成qm文件
    lrelease $target/*
    # 生成qrc文件
    echo '<RCC>' > $target.qrc
    echo '    <qresource prefix="/resources">' >>  $target.qrc
    find $target -type f -name '*.qm' | xargs -i echo -e "        <file>{}</file>" >> $target.qrc
    echo '    </qresource>' >> $target.qrc
    echo '</RCC>' >> $target.qrc
done

# 生成 desktop 文件
deepin-desktop-ts-convert ts2desktop ../deepin-home.desktop deepin-home-desktop deepin-home.desktop
mv deepin-home.desktop ../